<?php
/*
 * MiniMe - a minimalistic OStatus complient microblogging tool
 * Copyright (C) 2010, Tuomas Koski - koski.tuomas@gmail.com
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

/**
 * <entry>
 *  <title>Testkoski is testing.</title>
 *  <link rel="alternate" type="text/html" href="http://identi.ca/notice/46665690"/>
 *  <id>http://identi.ca/notice/46665690</id>
 *  <published>2010-08-19T07:44:07+00:00</published>
 *  <updated>2010-08-19T07:44:07+00:00</updated>
 *  <content type="html">Testkoski is testing.</content>
 *  <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
 *  <activity:object-type>http://activitystrea.ms/schema/1.0/note</activity:object-type>
 *  <statusnet:notice_info local_id="46665690" source="web"></statusnet:notice_info>
 *  <link rel="ostatus:conversation" href="http://identi.ca/conversation/46308829"/>
 *  <georss:point>48.8601 2.3507</georss:point>
 * </entry>
 * 
 * @author     Tuomas Koski <koski.tuomas@gmail.com>
 * @copyright  Tuomas Koski
 * @license    http://www.gnu.org/licenses/lgpl.txt
 */
class Mm_Atom_Element_Entry extends Mm_Xml_Element_Parent {
    
    const ELEMENT_TITLE          = 'title';
    const ELEMENT_LINK_ALTERNATE = 'link';
    const ELEMENT_ID             = 'id';
    const ELEMENT_UPDATED        = 'updated';
    const ELEMENT_CONTENT        = 'content';
    const ELEMENT_OBJECT_TYPE    = 'object-type';
    
    const ELEMENT_VERB           = 'verb';
    const ELEMENT_AUTHOR         = 'author';
    const ELEMENT_ACTIVITY_OBJECT = 'activity:object';
    const ELEMENT_ACTIVITY_ACTOR = 'activity:actor';
    
    protected $tagname = "entry";
    
    public function __construct(array $childElements, array $namespaces) {
        parent::__construct($childElements);
        $this->setNamespaces($namespaces);
    }
    
    public function getTitle() {
        return $this->getChildElement(self::ELEMENT_TITLE);
    }
    
    /**
     * @return Mm_Atom_Element_Author
     */
    public function getAuthor() {
        return $this->getChildElement(self::ELEMENT_AUTHOR);
    }
    
    public function getAlternateLink() {
        return $this->getChildElement(self::ELEMENT_LINK_ALTERNATE);
    }
    
    public function getId() {
        return $this->getChildElement(self::ELEMENT_ID);
    }
    
    public function getUpdated() {
        return $this->getChildElement(self::ELEMENT_UPDATED);
    }
    
    public function getContent() {
        return $this->getChildElement(self::ELEMENT_CONTENT);
    }
    
    public function getActivityStreamObjectType() {
        return $this->getChildElement(self::ELEMENT_OBJECT_TYPE);
    }
    
    public function getActivityStreamVerb() {
        return $this->getChildElement(self::ELEMENT_VERB);
    }
}